<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class IntegralPlan extends Model
{
    //積分方案 購買方案
    protected $table = 'integral_plan';

    protected $appends=['valid_duration'];

    public function getValidDurationAttribute(){
       return ($this->valid_year * 31536000) + ($this->valid_month * 2626560) + ($this->valid_day * 86400)
           + ($this->valid_time * 3600) + ($this->valid_minute * 60) + ($this->valid_s);
    }

    public function getCoveAttribute($value){
        return getDomain().'/'.$value;
    }

}
